<template>
    <div class="newsinfo_root">
        <div class="newsinfo_title">
            <h3>{{message[0].title}}</h3>
            <p>
                <span>{{message[0].add_time | datafmt("YYYY-MM-DD")}}</span>
                <span>{{message[0].click}}次浏览</span>
            </p>
        </div>
        <div v-html="message[0].content" class="newsinfo_body">
        </div>
    </div>
</template>

<script>
    export default {
        data()
    {
        return {
            message: [{title:0}]
        }
    },
    created()
    {
        this.getNewsinfo()
    },
    methods:{
        getNewsinfo()
        {
            let url = 'http://webhm.top:8899/api/getnew/'
            let paramsId = this.$route.params.id;
            url += paramsId
            this.$http.get(url).then(function (res) {
                this.message = res.body.message;
            })
        }
    }
    }
</script>

<style scoped>
    .newsinfo_root {
        margin-top: 40px;
        margin-bottom: 50px;
    }
    .newsinfo_title h3{
        color: #0094ff;
    }
    .newsinfo_title p{
        color:rgba(0,0,0,0.5);
    }

    .newsinfo_title,.newsinfo_body{
        padding: 5px;
    }
</style>